package com.itheima.business.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.nio.charset.StandardCharsets;
@Data
@Configuration
@ConfigurationProperties(prefix = "secret")
public class SecretProperties {

    //JWT令牌秘钥
    private String jwtSecret;

    //获取JWT令牌秘钥
    public byte[] getJwtBytes(){
        return jwtSecret.getBytes(StandardCharsets.UTF_8);
    }
}
